﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPI.General;
using PPI.WebConsumer.PPI.Svc;

namespace PPI.WebConsumer
{
    public class WDeploy
    {
        public static string StartDeployGPS(int utilityId, string utilityName, int vendorId, string vendorName,int projectId, string projectName, int contactId, string contactName, int handheldId,string handheldName, string mobileVersion)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.Deploy_StartDeployGPS(utilityId, utilityName, vendorId, vendorName, projectId, projectName, contactId, contactName, handheldId, handheldName, reader.ConectionMode,mobileVersion);
        }

        public static string StartDeployInspection(int handheldId, string handheldName, int inspectorId, string inspectorName, int companyId, string companyName, string mobileVersion, int vendorId, string vendorName, int projectId, string projectName, int contactId, string contactName)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            return svc.Deploy_StartDeployInspection(handheldId, handheldName,inspectorId,inspectorName,companyId,companyName,reader.ConectionMode, mobileVersion,vendorId,vendorName,projectId,projectName,contactId,contactName);
        }

        public static string StartDeployProject(int handheldId, string handheldName, string mobileVersion)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new PPI.Svc.Service1();

            svc.Timeout = System.Threading.Timeout.Infinite;
            return svc.Deploy_StartDeployProject(handheldId, handheldName, reader.ConectionMode, mobileVersion);
        }

        public static string StartDeployDistribution(int distributionAppMode)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new Service1();
            
            return svc.Deploy_StartDeployDistribution(reader.ConectionMode, distributionAppMode);
        }


        public static string StartDeployDistribution(int vendorId, string vendorName, int vendorContactId, string vendorContactName, int distributionAppMode, int vendorProjectId, int utilityId, string utilityName)
        {
            ConfigReader reader = ConfigReader.GetInstance();
            PPI.Svc.Service1 svc = new PPI.Svc.Service1();
                        
            return svc.Deploy_StartDeployDistribution_Vendor(reader.ConectionMode, distributionAppMode, vendorId, vendorName, vendorContactId, vendorContactName, vendorProjectId, utilityId, utilityName);
            //return svc.Deploy_StartDeployDistribution("DEV", distributionAppMode);
        } 
    }
}
